<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script src="jquery.min.js"></script>
<script>
    function Student() {
    }

    //实例化学生对象
    let s1 = new Student();
    s1.name = "zs"
    s1.age = 18
    s1.run = function () {
        alert(this.name + ":" + this.age);
    }
    s1.run()
    let p1 = {};
    p1.name = "li"
    p1.age = 11
    p1.run = function () {
        alert(this.name + ":" + this.age);
    }
    p1.run()
    let p2 = {
        name: "张学友",
        age: 18,
        run: function () {
            alert(this.name + ":" + this.age);
        }
    }

//    通过数组装对象的方式 封装几个商品的数据
    let arr = [{tit:"小米手机",price:3000,num:1000},
               {tit:"华为手机",price:3000,num:1000},
               {tit:"大疆手机",price:3000,num:1000},
    ];




</script>
</body>
</html>